翻訳と辞書
Words near each other
・ Mock & Sweet
・ Mock & Toof
・ Mock (surname)
・ Mock auction
・ Mock Auctions Act 1961
・ Mock combat
・ Mock draft
・ Mock duck
・ Mock election
・ Mock election in the King's Bench Prison
・ Mock execution
・ Mock interview
・ Mock Mayor
・ Mock modular form
・ Mock Morris
Mock object
・ Mock olive
・ Mock orange
・ Mock Orange (album)
・ Mock Orange (band)
・ Mock Spanish
・ Mock strawberry
・ Mock the Week
・ Mock trial
・ Mock trumpet
・ Mock Tudor (album)
・ Mock Turtle
・ Mock turtle soup
・ Mock Turtles (opera)
・ Mock, California


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Mock object : ウィキペディア英語版
Mock object
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.
== Reasons for use ==

In a unit test, mock objects can simulate the behavior of complex, real objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test. If an actual object has any of the following characteristics, it may be useful to use a mock object in its place:
* the object supplies non-deterministic results (e.g., the current time or the current temperature);
* it has states that are difficult to create or reproduce (e.g., a network error);
* it is slow (e.g., a complete database, which would have to be initialized before the test);
* it does not yet exist or may change behavior;
* it would have to include information and methods exclusively for testing purposes (and not for its actual task).
For example, an alarm clock program which causes a bell to ring at a certain time might get the current time from the outside world. To test this, the test must wait until the alarm time to know whether it has rung the bell correctly. If a mock object is used in place of the real object, it can be programmed to provide the bell-ringing time (whether it is actually that time or not) so that the alarm clock program can be tested in isolation.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Mock object」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.